﻿using MediatR;
using T_vehicle.Domain;
using T_vehicle.Infrastructure.Interfacec;
using T_vehicle.Read.API.Application.Command.RepairRecordsCommand;

namespace T_vehicle.Read.API.Application.CommandHandlers.RepairRecordsCommandHandlers
{
    public class FanRepairRecordsCommandHandlers:IRequestHandler<FanRepairRecordsCommand,RepairRecords>
    {
        private readonly IRepairRepository repairRepository;

        public FanRepairRecordsCommandHandlers(IRepairRepository repairRepository)
        {
            this.repairRepository = repairRepository;
        }

        public  Task<RepairRecords> Handle(FanRepairRecordsCommand request, CancellationToken cancellationToken)
        {
            var list = repairRepository.GetModelAsync(request.RepairRecordsId);
            return  list;
        }
    }
}
